<template>
    <div class="table">
        <div class="crumbs">
            <el-breadcrumb separator="/">
                <el-breadcrumb-item :to="{ path: '/home' }">
                    <i class="el-icon-menu"></i>首页</el-breadcrumb-item>
                <el-breadcrumb-item>
                    {{ $route.name}}
                </el-breadcrumb-item>
            </el-breadcrumb>
        </div>
        <div class="handle-box">
            <el-dialog :title="title" :visible.sync="dialogFormVisible">
                <el-form :model="addForm">
                </el-form>
                <div slot="footer" class="dialog-footer">
                    <el-button @click="dialogFormVisible = false">取 消</el-button>
                    <el-button type="primary">确 定</el-button>
                </div>
            </el-dialog>
            <el-input v-model="select_word" placeholder="输入机构名" class="search"></el-input>
            <el-button type="primary" icon="search">搜索</el-button>
            <el-button type="primary">新增机构</el-button>
        </div>
        <div>
            <el-table :data="page.content" border fit style="width: 100%">
                <el-table-column prop="name" label="机构名" show-overflow-tooltip>
                </el-table-column>
                <el-table-column fixed="right" label="操作">
                    <template slot-scope="scope">
                        <el-button type="text" @click="editOrg(scope.row)" size="small">编辑</el-button>
                        <el-button type="text" @click="delOrg(scope.row)" size="small">删除</el-button>
                    </template>
                </el-table-column>
            </el-table>
        </div>
        <div class="block">
            <el-pagination @current-change="handleCurrentChange" :current-page="page.number+1" layout="total, prev, pager, next, jumper" :total="page.totalElements">
            </el-pagination>
        </div>
    </div>
</template>
<script>
import { mapState, mapActions } from 'vuex'
export default {
    data() {
        return {
            value: '',
            loading: false,
            dialogTableVisible: false,
            dialogFormVisible: false,
            select_word: '',
            addForm: {

            },
            formLabelWidth: '120px',
            page: {}
        }
    },
    created() {

    },
    computed: mapState({
    }),
    methods: {

    }
}
</script>
<style lang="scss" scoped>
.handle-box {
  margin-bottom: 1%;
  .search {
    width: 30%;
  }
}

.block {
  text-align: center;
  margin-top: 1%;
}
</style>